<?php
/**
 * clitest.php
 * Tests cli.php script.  Outputs the calling script and whether the cron flag
 * is set.
 *
 * To test:
 *      1. Add {{clitest}} to a wiki page's content
 *      2. Load page in browser
 *      3. Call page from commandline: php -f cli.php PageName
 *
 * References
 *      http://docs.wikkawiki.org/UsingActions
 *
 * @package		Actions
 * @version		$Id$
 * @license		http://www.gnu.org/copyleft/gpl.html GNU General Public License
 * @filesource
 *
 * @uses	Wakka::LoadAll()
 * @uses	Wakka::GetConfigValue()
 *
 * @output      last page updated (from database)
 * @otuput      Debug info, including print out of this file
 */

// Defaults
$ActionDefaults = array(
);

// Initialize
$php_self = $_SERVER['PHP_SELF'];
$script_url = ( ! empty($_SERVER['SCRIPT_URL']) ) ? $_SERVER['SCRIPT_URL'] : 'n/a';
$cli_allowed = ( defined('ALLOW_CLI') && ALLOW_CRON );
$show_cli = ( $cli_allowed )  ? 'true' : 'false';
$linebreak = ( ! $cli_allowed ) ? '<br />' : '';


# Output
# Template
$output_t = <<<XHTML
Calling Script: %s%s
URL: %s%s
Allow CLI: %s
XHTML;

# Print
printf($output_t, $php_self, $linebreak, $script_url, $linebreak, $show_cli);
?>
